// console.log("Hello World!")

// console.log(Date);
// console.log(Math);
// console.log(setTimeout);
// console.log(setInterval);
// console.log(setImmediate);
// console.log(__filename);
// console.log(__dirname);
// console.log(process);

// 实现石头剪刀布游戏
// console.log(process.argv);

var playerActioin = process.argv[process.argv.length - 1];
console.log(playerActioin);

var random = Math.random() * 3;

if (random < 1) {
  var computerAction = "rock";
} else if (random > 2) {
  var computerAction = "scissor";
} else {
  var computerAction = "paper";
}

if (computerAction == playerActioin) {
  console.log("平局");
} else if (
  (computerAction == "rock" && playerActioin == "paper") ||
  (computerAction == "scissor" && playerActioin == "rock") ||
  (computerAction == "paper" && playerActioin == "scissor")
) {
  console.log("你赢了");
} else {
  console.log("你输了");
}

